Circuits and methods for amplifying signals

ABSTRACT

The present invention discloses a bus pumping compensation for a pulse modulation circuit such as class D modulators. The compensation according to the present invention provides a compensation current controlled by the output voltage, with the compensation characteristics matching the reverse current for improving circuit efficiency. Embodiments of the present invention also disclose a designable compensation circuit, comprising a linear compensation current, offering a good trade-off between circuit efficiency and ease of design. The present invention compensation circuit is preferably employed in a class D amplifier with substantial reverse current, and most preferably added into a LDO power supply in a class D amplifier circuit to prevent reverse current problem. The disclosed class D amplifier circuit is preferably used in an audio media player.

This application claims priority to U.S. Provisional Patent ApplicationNo. 60/797,978 filed on May 5, 2006. This application claims the benefitof the provisional's filing date under 35 U.S.C. §119(e), and saidprovisional application is hereby incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates generally to compensation circuitry inelectronic circuits and devices and more particularly to a power supplycompensation circuit in class D modulators.

BACKGROUND OF THE INVENTION

Amplifiers traditionally have been linear, including various variationsof class A, class B and class AB, with power output transistors actingas linear regulators to modulate the output voltage. A recentdevelopment in high efficiency amplifier design is the class Damplifier, which is basically a switching amplifier with the switcheseither fully on or off, thus significantly reducing the power losses inthe power output devices.

For analog inputs, a class D amplifier operates by first converting theinput into a modulated digital signal, which then is amplified, and thenis filtered to recover an analog output signal. In the class Damplifier, only the digital signal is amplified by on/off digital signalprocessing, thus, class D amplifiers can have very high power efficiencysince they provide substantially full output power, while minimizinginternal power consumption.

FIG. 1 shows a prior art typical class D amplifier, comprising acomparator 13, a sawtooth waveform generator 12, a class D switchingstage 15, a filter 17 and a load 19. An input Vi 10 is first compared(in the comparator 13) with a sawtooth comparator signal 11 (generatedby the sawtooth generator 12) to generate a digital modulated signal 14.The modulated signal 14 is composed of a series of pulses, with thewidth of each pulse being proportional to the amplitude of the inputvoltage Vi. The modulated signal 14 is then used to drive a class Dswitching stage 15, generating a modulated digital signal 16. Afterpassing through the low-pass filter 17, the digital signal 16 isconverter back to an analog signal Vo 18, with amplified magnitude, todrive a load 19. A class D amplifier typically includes the class Dswitching stage 15 and the filter 17.

One important component of class D amplifiers is the modulationcircuitry. A popular class D modulator, Pulse Width Modulation (PWM),provides a constant frequency pulse signal whose pulse width variesproportionally to the input signal. Other class D modulation techniquescan also be used, such as pulse density modulation (PDM), or pulsefrequency modulation (PFM). An indispensable component of class Damplifiers is the low-pass filter, typically an LC-type low-pass filter.

There are basically two class D topologies, a half-bridge with 2 outputdevices and a full-bridge with 4 output devices. The half-bridge designis simpler and more flexible, but can exhibit a “bus pumping” phenomenonwhere supply current sinks back to the power supply from the amplifier.Such changes in current direction are problematic for Low Dropout (LDO)voltage regulators, which can source current but are usually incapableof sinking current. Any standard LDO that is presented with a reverse(sink) current rather than a source current will respond by shuttingoff, and its output voltage will rise dramatically, usually above theLDO's input voltage. LDO “regulation” is then lost, resulting in thecomplete loss of the class D amplifier's output voltage regulation.

Various prior art conventional solutions exist to eliminate the problemsassociated with class D reverse current. However, these solutions arenot universally accepted since no solution is suitable for all designlimitations. An obvious prior art solution is the use of a battery topower the class D amplifier where the reverse current operates to chargethe battery. The design limitation of this solution is that not allclass D amplifier topologies are intended to operate from theunregulated battery voltage, relying instead on a well-controlledvoltage (LDO) source. Another solution is the incorporation of a largecapacitor capable of recovering the energy going back into the powersupply. The major drawback of this solution is the extra space neededsince a large capacitor takes up a significant real estate in a systemfloor plan. Another solution is to take advantage of any other powerrequirements in the overall system by supplying the class D amplifierpower from the same power source. For example, if the rest of the systemconsumes 20 mA, and if the maximum reverse current is only 10 mA, then apower supply supplying the total power will always see a net drain ofcurrent, and thus will be stable. A drawback of this solution is thevagaries of system load currents. One more solution is to simply add aresistor between the output of the power supply and ground, whose valuesinks a current larger than the anticipated reverse current from theclass D amplifier. The main disadvantage of this approach is that theLDO must then continually source this current, wasting system power.

Still another solution is the use of differential loading. FIG. 2 showsa schematic of this solution, where one of the paths is always providinga forward current, and if the forward current always exceeds the reversecurrent, then the net current is always forward. The problem with thissolution is that it is not an available option if the load is inherentlysingle ended as in the case of conventional headphone. Another solutionis a push-pull voltage source, shown in FIG. 3, which is a regulatedvoltage source (Vs) that is capable of both sourcing and sinkingcurrent. The reverse current in this voltage source is designed to beshunted to ground instead of capturing in a storage element or using forother useful purpose. The efficiency of the overall circuit is reducedsomewhat due to the disposal of the reverse current. Beside the loss ofefficiency, another drawback of this design is the special design of thepower supply to allow the sinking of reverse current.

SUMMARY OF THE DESCRIPTION

Embodiments of the present invention disclose a compensation method andcircuit for a pulse modulation circuit, especially for class Dmodulators, to compensate for the reverse current of the power supply.The compensation according to at least certain embodiments of thepresent invention provides a compensation current controlled by theoutput voltage of the modulator for improving operation.

One embodiment of the present invention thus comprises a modeling of thereverse current from the modulator, and then designing a compensationcircuit having essentially the same voltage dependent characteristics,but with a reverse polarity, as the reverse current. With the reversecurrent being a function of the output load voltage amplitude andpolarity, the compensation circuit can be designed to match the reversecurrent of a particular modulator circuitry, resulting in minimizingpower loss due to overcompensation.

The similarity of the voltage dependent characteristics of thecompensation current can cover the whole range of operating voltages foroptimum efficiency, and preferably match only the shape and theamplitude for a pre-determined range of operating voltages for ease ofcircuit design.

In another embodiment, the present invention also discloses a universalcompensation circuit, suitable for many modulator circuits withdesignable components. The disclosed compensation circuit provides agradually-sloped stepping compensation current, comprising a zerocompensation current when there is no reverse current, a constantcompensation current in the voltage range of maximum reverse current,and a gradually transition current, connecting the other two currents.The zero compensation current is preferably corresponding to thepositive output voltage range of the modulator. The constantcompensation current is preferably matched to the maximum reversecurrent, and the switchover preferably occurs in the vicinity of theoperating voltage corresponding to the maximum reverse current.

In a preferred embodiment, the compensation circuit comprises anamplifier, preferably a linear amplifier such as an operationalamplifier, to provide the gradually-sloped current, together with aclamping circuit to clamp the transitional current at a maximum valueand a zero value.

Embodiments of the present invention further disclose a class Damplifier comprising a compensation circuit to compensate for thereverse current. The compensation circuit creates an as-needed currentload for the power supply based on the values of the output voltage ofthe amplifier. In a preferred embodiment, the compensation circuit canbe added into the LDO power supply in a class D amplifier circuit toprevent the amplifier's reverse supply current from causing theamplifier's supply voltage to rise uncontrollably. The disclosed class Damplifier circuit may be used in a media player to generate audiosignals through headphones, speakers, or other audio transducers.

Embodiments of the present invention can also be used in conjunctionwith other compensation circuits such as energy storage, DC loading,differential drive or push-pull voltage source.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a prior art schematic of a class D amplifier.

FIG. 2 shows a prior art reverse current solution for differentialloading.

FIG. 3 shows a prior art reverse current solution using a push-pullvoltage source.

FIG. 4 shows a schematic of a class D amplifier with various waveforms.

FIG. 5 shows a model of a coupling capacitor in a class D amplifier.

FIG. 6 shows another model of a coupling capacitor in a class Damplifier.

FIG. 7 shows a reverse IV relationship for output voltage before acoupling capacitor.

FIG. 8 shows a reverse IV relationship for a load output voltage.

FIG. 9 shows an embodiment of the present invention compensation circuitfor a class D amplifier.

FIG. 10 shows a schematic of a compensation circuit for a class Damplifier according to the present invention.

FIG. 11 shows the compensation current and the total current from thepower supply according to an embodiment of the present inventioncompensation circuit for a class D amplifier.

FIG. 12 shows a schematic of a compensation circuit for a dual amplifierfor stereo audio headphone applications.

FIG. 13 shows a block diagram of an exemplary embodiment for a mediaplayer according to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the present invention disclose a methodology and circuitsto prevent the reverse current which flows back to the power supply in amodulator, especially in a class D modulator, from forcing theamplifier's supply voltage to rise uncontrollably. Recognizing that thereverse current is a function of the output voltage and phase,embodiments of the present invention discloses a compensation circuitproviding a compensation current for the reverse current with thecompensation current controlled by the output voltage amplitude andphase.

One embodiment of the present invention compensation circuit thuscomprises a modeling of the reverse current from the modulator, and thenusing the reverse IV relationship between the reverse current and theoutput voltage to design a compensation circuit with a compensation IVtransfer function matching the reverse IV relationship with the outputvoltage and phase as the control signal. Since the reverse current is afunction of the output load voltage and phase, the compensation circuitaccording to the present invention can be tailored to fit the reversecurrent of a particular circuitry, minimizing power loss due toovercompensation.

The following section provides an exemplary modeling of the reversecurrent in a modulator circuit. Shown in FIG. 4 is a typical schematicof a class D amplifier, comprising a power supply Vs, a switching stage21 driven by a modulated signal 31, a filter 22, and a load 23, togetherwith the signal waveforms.

The switching circuit 21 is controlled by a PWM modulated 0-Vi pulsesignal 31, which is generated from a modulation logic in an earlierstage. The modulated signal 31 is digitally amplified by the switchingcircuit 21 to become an amplified modulated 0-Vs pulse signal 32. Theamplified modulated signal 32 retains the same pulse form as themodulated signal 31, but with the amplitude amplified from Vi to Vs. Theamplified modulated signal 32 is then recovered with an LC filter 22that must remove the high frequencies of the modulation and pass thesignal frequencies. The low pass LC filter 22 is designed to pass thefrequencies of interest, which in this case is audio frequencies andtypically in the range of 10 to 30 kHz. The digital signal 32 becomes ananalog signal Va after passing through the low pass filter 22, with thevoltage amplitude being Vs times the duty cycle, where the duty cycle isdefined as the time that switch is connected to Vs divided by the periodof the (fixed) modulating digital frequency.

Depending on the design, the signal Va in FIG. 5 may or may not have aDC component. In this example, signal Va has a DC component. A couplingcapacitor Cc can be used to remove the DC component, resulting in an ACsignal Vo at the load resistor, RL.

A major advantage of class D amplifier is that it can be very efficient,since the switching amplifier 21 can be practically lossless. Thisexample shows a basic class D amplifier, however, in practice, class Damplifiers can further include feedback circuits, or design improvementcircuits to remove nonlinearities, timing errors, unwanted componentcharacteristics, parasitic components, or power supply fluctuation inthe modulation, filter or power supply circuits.

Another cause of degradation in class D amplifier is bus pumping (orreverse current, or sinking current) where current from the load flowsback into the power supply. The current in a class D amplifier istypically bi-directional, meaning there is times where the circuit sendscurrent back to the power supply, which is a predictable artifact of thearchitecture. If the power supply cannot absorb the reverse current, thesupply voltage pumps up, creating major power supply fluctuations. Sincethe gain of a class D amplifier is directly proportional to the powersupply Vs, any fluctuation in Vs produces signal distortion.

The origin of bi-directional supply current of the circuit isillustrated as follows. As shown in FIG. 5, assuming symmetrical signalsuch as audio signals, the DC component of the signal would be Vs/2,thus the coupling capacitor Cc will charge up to Vs/2, and can bemodeled by a Vs/2 battery. This substitution serves to simplify thecalculation of the load current Io through the load R_(L). Replacing Ccwith a battery equal to Vs/2 and swapping its placement with RL, as inFIG. 6, it is now apparent that the voltage across R_(L), and hence thecurrent through it (Io), is both positive and negative.

The current Io shown in FIG. 6 is a time-average current through anideal lossless circuit, resulting from the filtering of the modulatedsignal. Other currents, for example the current through the inductor,can exhibit instantaneous response when the switching circuit switchesbetween ground and Vs. For practical circuits, Io would include a losscurrent component I_(LOSS).

From the simplified circuit of FIG. 5 or FIG. 6, the current Io iscalculated to be:

${Io} = {\frac{{Va} - \frac{Vs}{2}}{R_{L}} = {\frac{Va}{R_{L}} - \frac{Vs}{2R_{L}}}}$

In any lossless buck switching regulator, the input power equals theoutput power,

$\begin{matrix}{{or}{{{{Power}\mspace{14mu} {in}} = {{{Vs}*{Is}} = {{{power}\mspace{14mu} {out}} = {{Va}*{Io}}}}},{so}}{{Is} = {{\frac{Va}{Vs}{Io}} = {\frac{Va}{Vs}\left( {\frac{Va}{R_{L}} - \frac{Vs}{2R_{L}}} \right)}}}{or}{{Is} = {\frac{{Va}^{2}}{{Vs} \cdot R_{L}} - \frac{Va}{2R_{L}}}}} & \lbrack 1\rbrack\end{matrix}$

FIG. 7 shows a typical plot of this Is-Va curve for Vs=2.5 V andR_(L)=16Ω. This plot illustrates that for the operating voltage range of0-2.5V, the power source must be able to source (deliver) about 80 mAand sink (receive) about 10 mA with the sinking current flowing backwardto the power supply.

Presuming a loss current I_(LOSS) due to the inefficiency of thecircuit, and re-writing the supply current Is in terms of the loadvoltage Vo, the supply current Is becomes:

$\begin{matrix}{{Is} = {\frac{{Vo}^{2}}{R_{L} \cdot {Vs}} + \frac{Vo}{2R_{L}} + I_{LOSS}}} & \lbrack 2\rbrack\end{matrix}$

and the corresponding Is-Vo curve is shown in FIG. 8 for Vs=2.5 V andR_(L)=16Ω.

The source of the class D amplifier's reverse power supply current isnow obvious from FIG. 8. The compensation of this sinking or reversecurrent is one of the goals of the present invention, since this reversecurrent when using with a LDO power supply will cause supply voltagefluctuation, creating output signal distortion.

With the reverse Is-Vo relationship known, a compensation circuit can bedesigned and incorporated into the power supply to completely compensatethe reverse current, to shunt the reverse current away from the class Damp's power supply to ensure that the power supply always has a positivedrain.

The transfer function for the compensation circuit is modeled from thereverse IV relationship, and thus is best optimized when the two curves,the reverse IV relationship and the compensation IV relationship, areperfectly matched so that the resulting power supply current is zerowhenever the circuit exhibits reverse current, for the whole range ofoperating output voltages.

In a preferred embodiment, the compensation circuit is conservativelydesigned, using a higher compensation current than the reverse currentin a certain range of operating voltages, to account for component andcircuit variations.

A higher compensation current than the corresponding class D amplifierreverse current means that the amplitude of the compensation current ishigher than the amplitude of the reverse current, and therefore the netcurrent out of the LDO is positive, defined as the current flowing outfrom the power supply. One goal of the invention is to always maintain apositive current out of the LDO in order to keep the LDO's outputvoltage within regulation.

In another preferred embodiment, the compensation circuit is designed sothat the compensation IV relationship matches the reverse IVrelationship for only a predetermined range of operating outputvoltages. The compensation circuit is much easier to design for asmaller matching range, in exchange for a higher power loss. Thereforethe present invention allows the trade-off between circuit performanceand circuit simplicity by restricting the matching for only a portion ofthe operating output voltages, preferably for the operating outputvoltage range in the vicinity of zero volts.

For a positive load, there is no reverse current for the range ofpositive output load voltage. Thus the present invention furtherdiscloses that the compensation circuit provides zero compensationcurrent in the range of positive output voltages.

In another preferred embodiment, the present invention also discloses auniversal compensation circuit, suitable for many modulator circuitswith only a few design constraints. The disclosed compensation circuitcomprises a zero compensation current in the positive output voltagerange, a constant compensation current in the negative output voltagerange, and a transition current, gradually connecting the constantcompensation current with the zero compensation current. The constantcompensation current preferably matches the maximum reverse current toensure positive total supply current. The compensation current ispositive to compensate for the negative reverse current, thus thetransition current gradually decreases from the maximum reverse currentto a zero current with respect to an increase in output voltage. Thetransition IV curve is preferably linear for ease of circuit design,with a slope matching that of the reverse IV relationship. The transferfunction of the compensation circuit becomes a three-segmentrelationship, resembling a gradually-sloped stepping function. Since thecompensation current and the reverse current have opposite polarity withrespect to a given voltage, slope matching means the matching of themagnitude of the slope values of the two compensation and reverse IVcurves.

FIG. 9 shows a preferred embodiment of the present inventioncompensation circuit 73 employing three-segment compensation IVrelationship. The compensation circuit 73 provides a compensation loadfrom the power supply LDO 71, compensating for a reverse current fromthe class D amplifier 72, with a control voltage being the load outputvoltage Vo, taken from the circuit load R_(L). The compensation circuit73 comprises a control input from the output voltage Vo to control acurrent Ic from the power supply LDO to the ground. The transferfunction Ic-Vo of the compensation circuit comprises a three-segment IVrelationship: a constant current in the negative voltage range, a zerocurrent in the positive voltage range, and a gradually decreasing,preferably linear, current in the transition range from the negative tothe positive voltage. The constant compensation current is preferablyequal to the maximum reverse current, and the slope of the transitionsegment is preferably equal to the slope of the reverse IV relationship.These constraints are served to select the components of thecompensation circuit.

FIG. 10 shows an exemplary circuit detail of the three-segmentcompensation circuit. A power supply LDO provides power to the class Dpower amplifier and also to the compensation circuit 83. The schematicfor the class D amplifier is similar to that of FIG. 4, with theaddition of a loss current source I_(LOSS) to represent theinefficiencies of the amplifier circuit. The compensation circuit 83comprises a resistive compensation load Rc, controlled by a transistorswitch Q and a linear operational amplifier OP. There are three rangesof operation voltages, controlled by the output voltage Vo, allcontrolled by the transistor switch Q and the op amp OP. Transistor Qprovides a clamping function at both sides of the linear amplificationcurve of the operational amplifier OP, generating the desiredthree-segment transfer function.

The compensation circuit can only sink current due to the presence oftransistor Q; it is incapable of sourcing current. Thus when the voltageV−, the voltage at the input of op amp OA's negative input, is greaterthan zero volts, the output Vx is clamped at zero volts, forcing thecompensation current Ic to be zero. The range of output voltages forwhich the compensation current equals zero is determined by resistors R1and R3 as follows:

If V−≧0 then

$\frac{Vs}{R\; 3} \geq {- \frac{Vo}{R\; 1}}$ or${Vo} \geq {- \frac{{{Vs} \cdot R}\; 1}{R\; 3}}$

Thus, for the compensation circuit 83, the compensation current Ic iszero when the output voltage Vo is more positive than −(Vs·R1)/R3.

When Vo<−(Vs·R1)/R3, the operational amplifier OP starts operating, withthe current through resistor R2 is the sum of the current through R1 andR3. For op amp analysis, V− is held at virtual ground and can beconsidered to be zero, thus

$\frac{Vx}{R\; 2} = {{- \frac{Vo}{R\; 1}} - \frac{Vs}{R\; 3}}$ or${Ic} = {{- \frac{R\; 2}{R\; c}}\left( {\frac{Vo}{R\; 1} + \frac{Vs}{R\; 3}} \right)}$

The upper limit of the compensation current provided by the compensationcircuit occurs when op amp OA's output voltage reaches its maximumoutput voltage, Vs, thus limiting the compensation current Ic to amaximum value:

${{Ic}\mspace{11mu} \max} = {\frac{{Vs} - V_{BE}}{Rc} = {{- \frac{R\; 2}{Rc}}\left( {\frac{Vox}{R\; 1} + \frac{Vs}{R\; 3}} \right)}}$or${Vox} = {{{- \frac{{{Vs} \cdot R}\; 3}{R\; 2}} - {\frac{R\; 1}{R\; 2}\left( {{Vs} - V_{BE}} \right)}} \approx {{- \frac{R\; 1}{R\; 2}}\left( {{Vs} - V_{BE}} \right)}}$

where Vox is the value of Vo where Icmax is reached. Thus thecompensation current Ic is clamped also when Vo<−(VS−V_(BE))R1/R2.

Thus the disclosed compensation circuit provides three-segmentcompensation current Ic with respect to the output voltage Vo:

$\begin{matrix}{{Ic} = 0} & {{{for}\mspace{14mu} {Vo}} \geq {- \frac{{{Vs} \cdot R}\; 1}{R\; 3}}} \\{{{Ic} = {{- \frac{R\; 2}{Rc}}\left( {\frac{Vo}{R\; 1} + \frac{Vs}{R\; 3}} \right)}}} & {{{for}\mspace{14mu} - \frac{{{Vs} \cdot R}\; 1}{R\; 3}} \geq {Vo} \geq {{- \frac{R\; 1}{R\; 2}}\left( {{Vs} - V_{BE}} \right)}} \\{{Ic} = \frac{{Vs} - V_{Be}}{Rc}} & {{{for}\mspace{14mu} {Vo}} \leq {{- \frac{R\; 1}{R\; 2}}\left( {{Vs} - V_{BE}} \right)}}\end{matrix}$

An embodiment of the present invention further discloses a designcriterion for the three-segment compensation current by matching thecompensation with the reverse current of the power supply. Inparticular, the design criterion specifies that the slope of thecompensation current matches with the slope of the reverse current, thecompensation should start when the reverse current starts, and theconstant compensation matches the peak reverse current.

The slope of the compensation current can be conservatively approximatedby the slope of the reverse current of [2] at I=0 with no I_(LOSS). Thisgives the relationship of

$\begin{matrix}{{\frac{R\; 2}{{{Rc} \cdot R}\; 1} = \frac{1}{2R_{L}}}{or}{\frac{R\; 2}{R\; 1} = \frac{Rc}{2R_{L}}}} & \lbrack 3\rbrack\end{matrix}$

The output voltage Vo where the compensation current starts is set to bewhere the reverse current starts, thus when Is=0, from [2]

${Vo} = {{- \frac{Vs}{4}} + {\frac{V\; 2}{2}\left( {\frac{1}{4} - {\frac{4R_{L}}{Vs} \cdot I_{LOSS}}} \right)^{\frac{1}{2}}}}$

The compensation current starts when Vo=−(Vs·R1)/R3, thus

$\frac{R\; 1}{R\; 3} = {\frac{1}{4} - {\frac{1}{2}\left( {\frac{1}{4} - {\frac{4R_{L}}{Vs} \cdot I_{LOSS}}} \right)^{\frac{1}{2}}}}$

An alternative way to conservatively approximate this criterion is tointroduce the loss current I_(LOSS) to the compensation current, andthen starts the compensation current at Vo=0 and Ic=0:

$\begin{matrix}{{{Ic} = {{{- \frac{R\; 2}{Rc}}\left( {\frac{Vo}{R\; 1} + \frac{Vs}{R\; 3}} \right)} + I_{LOSS}}}{{{At}\mspace{14mu} {Vo}} = {{0\mspace{14mu} {and}\mspace{14mu} {Ic}} = {0\text{:}}}}{\frac{R\; 2}{R\; 3} = \frac{{Rc} \cdot I_{LOSS}}{Vs}}} & \lbrack 4\rbrack\end{matrix}$

The peak reverse current can be calculated from equation [2]

$I_{PEAK} = {{- \frac{Vs}{16R_{L}}} + I_{LOSS}}$

and this peak current matches the constant compensation current

$\begin{matrix}{{I_{PEAK} = {{{- \frac{Vs}{16R_{L}}} + I_{LOSS}} = \frac{{Vs} - V_{BE}}{Rc}}}{or}{{Rc} = \frac{16{R_{L}\left( {{Vs} - V_{BE}} \right)}}{{Vs} - {16{R_{L} \cdot I_{LOSS}}}}}} & \lbrack 5\rbrack\end{matrix}$

Equations [3], [4], and [5] provide the design relationships for thecorrection circuit design. FIG. 11 illustrates a desired compensationcurrent and the resulting compensated current for Vs=2.5 V andR_(L)=16Ω.

The present invention compensation circuit can be extended to dualamplifiers, shown in FIG. 12 for a complete class D solution for a dualamplifier for stereo audio headphone applications. The designrelationships for this circuit using the components illustrated are asfollowed, employing dual output voltage Vol and Vor:

$\begin{matrix}{\frac{R\; 2}{R\; 1} = \frac{Rc}{2R_{L}}} & \lbrack 6\rbrack \\{\frac{R\; 2}{R\; 3} = \frac{{Rc} \cdot I_{LOSS}}{Vs}} & \lbrack 7\rbrack \\{{Rc} = \frac{8{R_{L}\left( {{Vs} - V_{BE}} \right)}}{{Vs} - {8{R_{L} \cdot I_{LOSS}}}}} & \lbrack 8\rbrack\end{matrix}$

Embodiments of the present invention further disclose a class Damplifier which comprises a compensation circuit coupled to an output ofa source of power (power supply) and to an output of the amplifier. Thecompensation circuit creates an as-needed current load for the powersupply based on the values of the output of the class D amplifier. Thepower supply is typically a LDO power supply regulator circuit, and thecompensation circuit prevents any substantial reverse current fromeffecting the operation of the LDO power supply. In effect, thecompensation circuit acts as a load which is added to the LDO and classD amplifier loads when there is any substantial reverse current.

In certain embodiments, the LDO, compensation circuit, and the class Damplifier circuit may be used in a media (e.g. music) player to generateaudio power (e.g. the class D amplifier may drive headphones or otheraudio transducers). An example of such a media player is shown in FIG.13, in which the LDO receives power from a battery to provide regulatedpower to the class D amplifier, which includes the compensation circuitin the implementation. The regulated power source could also be derivedfrom any form of switching power supply; thus with appropriate LDOs, onebattery can serve all needed power voltage requirements. Therefore thebattery shown can be shared with other circuits. The PWM signal isapplied to the input of the class D amplifier which outputs a signal tothe stereo headphones. The music processor may retrieve music or othermedia from the memory, in response to a user input on the controlinterface, and cause a digital stream, representing the music to bemodulated by the digital (or analog) pulse width modulator to begenerated to drive the input to the class D amplifier.

1. A method for compensating for reverse power supply current of amodulator, the method comprising: generating a voltage-dependentcompensation current for the power supply to compensate for the reversecurrent, the compensation current controlled by an output voltage of themodulator circuit.
 2. A method as in claim 1 wherein the reverse currentis compensated by providing a higher magnitude of the compensationcurrent than that of the reverse current for a predetermined range ofoutput voltages.
 3. A method as in claim 1 wherein the magnitude of thecompensation current is always higher than the magnitude of the reversecurrent for the whole range of operating output voltages of themodulator circuit.
 4. A method as in claim 1 wherein the relationshipbetween the compensation current and the output voltage matches areverse IV relationship between the reverse current and the outputvoltage for a predetermined range of output voltages.
 5. A method as inclaim 4 wherein the matching comprises a degree of similarity betweenthe two relationships.
 6. A compensation circuit coupled to a powersupply and to a modulator circuit, wherein the power supply providespower to the modulator circuit, and wherein the modulator circuitcomprises an output, the compensation circuit sinking current on apredetermined pattern based on a value of the output of the modulator.7. A circuit as in claim 6 wherein the sinking current of thecompensation circuit compensates for a reverse current to the powersupply from the modulator circuit for a predetermined range of outputvoltages.
 8. A circuit as in claim 6 wherein the reverse current iscompensated by providing a sinking current having a higher magnitudethan that of the reverse current.
 9. A compensation circuit forcompensating a reverse current of a power supply in a modulator circuit,the compensation circuit comprising: a voltage-dependent load coupled tothe power supply, the voltage-dependent load controlled by an outputvoltage of the modulator circuit; wherein the compensation load iscontrolled by the output voltage with a compensation IV relationshipcomprising: a zero compensation current section corresponding to apositive output voltage, a constant compensation current sectioncorresponding to a positive output voltage, and a transitioncompensation current section connecting the zero compensation currentsection and the constant compensation current section.
 10. A circuit asin claim 9 wherein the magnitude of the constant compensation current ishigher than that of the maximum reverse current.
 11. A circuit as inclaim 9 wherein the transition compensation current is substantiallylinear from the constant compensation current to the zero compensationcurrent.
 12. A circuit as in claim 9 wherein the slope of the transitioncompensation current matches that of the reverse current.
 13. A circuitas in claim 9 wherein the transition from the transition compensationcurrent to the zero compensation current is in the vicinity of the zerooutput voltage of the modulator circuit.
 14. A compensation circuit forcompensating a reverse current of a power supply in a modulator circuit,the compensation circuit comprising: a compensation load coupled to thepower supply; a control circuit to control a compensation currentthrough the compensation load, the control circuit comprising: a linearamplifier circuit having an input coupled to the output voltage of themodulator circuit and a control output coupled to the compensation load;a clamping circuit coupled to the control output and to the compensationload to limit a compensation current through the compensation loadbetween a constant value and zero value.
 15. A circuit as in claim 14wherein the power supply is a LDO power supply.
 16. A circuit as inclaim 14 wherein the modulator circuit comprises a single-ended load.17. A circuit as in claim 14 wherein the modulator circuit comprises asingle or a dual class D amplifier.
 18. A circuit as in claim 14 whereinthe compensation load comprises a resistor.
 19. A circuit as in claim 14wherein the linear amplifier circuit comprises an operational amplifier.20. A circuit as in claim 14 further comprising a voltage dividercircuit coupled between the output voltage of the modulator circuit andthe input of the linear amplifier.
 21. A circuit as in claim 14 whereinthe clamping circuit comprises a transistor device.
 22. A class Damplifier comprising a compensation circuit for compensating a reversecurrent of a power supply coupled to the amplifier, the compensationcircuit coupled to the power supply and to the amplifier and sinkingcurrent on a predetermined pattern based on a value of an output of theamplifier.
 23. A class D amplifier comprising a compensation circuit forcompensating a reverse current of a power supply coupled to theamplifier, the compensation circuit comprising: a compensation loadcoupled to the power supply; a control circuit to control a compensationcurrent through the compensation load, the control circuit comprising: alinear amplifier circuit having an input coupled to the output voltageof the amplifier and a control output coupled to the compensation load;a clamping circuit coupled to the control output and to the compensationload to limit a compensation current through the compensation loadbetween a constant value and zero value.
 24. A processor coupled to aclass D amplifier, the processor presenting media through the class Damplifier, the class D amplifier comprising: a compensation circuit forcompensating a reverse current of a power supply coupled to theamplifier, the compensation circuit coupled to the power supply and tothe amplifier and sinking current on a predetermined pattern based on avalue of an output of the amplifier.
 25. A media player comprising aclass D amplifier, the class D amplifier comprising: a compensationcircuit for compensating a reverse current of a power supply coupled tothe amplifier, the compensation circuit coupled to the power supply andto the amplifier and sinking current on a predetermined pattern based ona value of an output of the amplifier.
 26. A media player comprising aclass D amplifier, the class D amplifier comprising a compensationcircuit for compensating a reverse current of a power supply coupled tothe amplifier, the compensation circuit comprising: a compensation loadcoupled to the power supply; a control circuit to control a compensationcurrent through the compensation load, the control circuit comprising: alinear amplifier circuit having an input coupled to the output voltageof the amplifier and a control output coupled to the compensation load;a clamping circuit coupled to the control output and to the compensationload to limit a compensation current through the compensation loadbetween a constant value and zero value.